<template>
	<DetailPage v-bind="detailConfig" :model="baseDetailData"></DetailPage>
</template>

<script setup lang="ts">
import DetailPage from '@/views/aplid/DetailPage/index.vue'
import { detailConfig } from '../../../config'
import { getAreaObj } from '@/utils/util'
import apiMod from '@/apiMod'

type Props = {
	nowRowData?: any
	chainViewInfo?: any
	isBlockchain?: boolean
}
const props = withDefaults(defineProps<Props>(), {
	nowRowData: {},
	chainViewInfo: {},
	isBlockchain: false,
})

let baseDetailData = ref({})
const getInitData = () => {
	const areaObj = getAreaObj(props.nowRowData, '', 'set')

	baseDetailData.value = {
		...props.nowRowData,
		areas_name: areaObj.names,
		areas: areaObj.areaIds,
	}
}

onBeforeMount(() => {
	if (props.isBlockchain) {
		baseDetailData.value = props.chainViewInfo
	} else {
		getInitData()
	}
})
</script>

<style scoped>
.bottom {
	margin-top: 13px;
	line-height: 12px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.detail-label {
	color: #eee;
}

.image {
	width: 90%;
	height: 220px;
	display: block;
}
</style>
